home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / OpenDoc Utilities / Interfaces / DictList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  2.6 KB  |  101 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DictList.h
  3.  
  4.     Contains:    Definition of class DictionaryList
  5.  
  6.     Owned by:    Richard Rodseth
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.     
  10. */
  11.  
  12. #ifndef _DICTLIST_
  13. #define _DICTLIST_
  14.  
  15. #ifndef _ODTYPES_
  16. #include "ODTypes.h"
  17. #endif
  18.  
  19. #ifndef _PLFMDEF_
  20. #include "PlfmDef.h"
  21. #endif
  22.  
  23. #ifndef _LINKLIST_
  24. #include "LinkList.h"
  25. #endif
  26.  
  27. //==============================================================================
  28. // Theory of Operation
  29. //==============================================================================
  30.  
  31. // OrdereCollection is an ordered collection of elements of type void* (since
  32. // we can't use templates)
  33. // Duplicates are allowed.
  34.  
  35. //==============================================================================
  36. // Constants
  37. //==============================================================================
  38.  
  39. //==============================================================================
  40. // Scalar Types
  41. //==============================================================================
  42.  
  43. typedef void* KeyType;
  44. typedef void* ValueType;
  45.  
  46. //=====================================================================================
  47. // Classes defined in this interface
  48. //=====================================================================================
  49.  
  50. class DictionaryList;    
  51.  
  52. //=====================================================================================
  53. // Classes used by this interface
  54. //=====================================================================================
  55.  
  56. class Association; // Defined in implementation
  57.  
  58. //=====================================================================================
  59. // Global Variables
  60. //=====================================================================================
  61.  
  62.  
  63. //=====================================================================================
  64. // Class DictionaryList
  65. //=====================================================================================
  66.  
  67. class DictionaryList
  68. {
  69.     
  70.  
  71. public:
  72.  
  73.     DictionaryList();
  74.     virtual ~DictionaryList();
  75.  
  76.     ODVMethod void    AddPair(KeyType key, ValueType value);
  77.     
  78.     ODVMethod ODULong Count();
  79.     ODVMethod ODBoolean ContainsKey(KeyType key);
  80.     ODVMethod ValueType ValueAtKey(KeyType key);
  81.  
  82.     ODVMethod void    RemoveKey(KeyType key);
  83.     ODVMethod void    RemoveAll();            
  84.     ODVMethod void    DeleteKeys();
  85.     ODVMethod void    DeleteValues();
  86.     ODVMethod void    DeleteSOMValues();
  87.     
  88. protected:
  89.  
  90.      ODVMethod Association* CreateNewAssociation(KeyType key, ValueType value) const;
  91.      ODVMethod ODBoolean    KeysMatch(KeyType key1,KeyType key2) const;
  92.      
  93.          // Does a straight == comparison by default 
  94.  
  95. private:
  96.  
  97.     LinkedList        fImplementation;
  98. };
  99.  
  100. #endif // _DICTLIST_
  101.